# -*- coding: utf-8 -*-
"""
Created on Fri Aug 26 11:04:27 2022

@author: xiong
"""
import re
import hashlib
import time

def mqSharesTemplate(data,taskid):
    userid = data["user_id"]
    md5_userid = hashlib.md5(userid.encode(encoding='UTF-8')).hexdigest()

    
    return {
            "type":"Facebook",
            	"share":[{
            		"vc_id":hashlib.md5(str(time.time()).encode(encoding='UTF-8')).hexdigest(),
            "vc_target_user_id":md5_userid,
            "vc_relation_user_id":"",
            "vc_post_id":data["post_id"],
            "vc_user_url":data["user_url"],
            "vc_user_id": userid,
            "vc_photo_url":data['user_profile_img'],
            "vc_photo_url_local":data['url_local'],
            "vc_nickname":data["user_name"],
            "text_share_text":"",
            "dt_share_date":"",
            "vc_share_id":"",
            "text_content":"",
            "dt_gather_time":time.strftime("%Y-%m-%d %H:%M:%S", data["dt_gather_time"]),
            "vc_task_type":"",
            "vc_md5":hashlib.md5((taskid+data["post_id"]).encode(encoding='UTF-8')).hexdigest()	
            }]
            }

